var sharePage = function () {
};
$(function () {
    sharePage = function () {
        this.init();
    };

    sharePage.prototype = {
        // 初始化
        init: function () {
            this.paintpage();
            this.bindEvent();
        },

        // 加载商品列表数据
        paintpage: function () {
            var html = [];
            html.push("<div id='sharePage' class='dingwei dingwei1' style='display: none'><div class='fenxiangbg'><div class='xftubiaok mbbottom overflow'>	<p class='xftubiao'  id='shareitem'>");
            html.push("<span><img src='../../images/wxan.png'/><br/>微信好友</span>");
            html.push("<span><img src='../../images/weixin1.png'/><br/>微信朋友圈</span>");
            html.push("<span><img src='../../images/xlan.png'/><br/>新浪微博</span>");
            html.push("<span><img src='../../images/xlan3.png'/><br/>QQ好友</span>");
            html.push("<span><img src='../../images/kongjian.png'/><br/>QQ空间</span>");
            html.push("<span><img src='../../images/qqan3.png'/><br/>邮件</span>");
            html.push("</p></div><p class='xfxqx' id='btncancelshare'>取消</p></div></div>");
            $("body").append(html.join(""));
        },

        // 绑定事件
        bindEvent: function () {
            var model = this;
            // 分享
            $("#shareitem span").on("tap", function () {
                // TODO 分享操作
                model.hide();
            });
            // 取消
            $("#btncancelshare").on("tap", function () {
                model.hide();
            });

            $("#sharePage").on("tap", function () {
                model.hide();
            });
        },
        // 当前显示状态
        isDisplay: false,
        // 显示
        show: function () {
            this.isDisplay = true;
            $("#sharePage").show();
        },
        // 隐藏
        hide: function () {
            this.isDisplay = false;
            $("#sharePage").hide();
        }
    };
});
